package com.zline.foodraise.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by heshantao on 15/8/5.
 * 用户地址
 */
public class UserAddressBean implements Parcelable {
    //城市ID
    long cityId;
    //详细地址
    String detailAddr;
    //是否是默认的
    int isDefault;
    //纬度
    double latPoint;
    //经度
    double lonPoint;
    //前半段地址
    String preAddr;
    //联系电话
    String receiverMobile;
    //联系人姓名
    String receiverName;
    //后半段地址
    String subAddr;
    //用户地址ID
    long userAddressId;
    //用户ID
    long userId;

    public UserAddressBean() {
    }

    public UserAddressBean(long cityId, String detailAddr, double latPoint,
                           int isDefault, double lonPoint, String preAddr, String receiverMobile,
                           String receiverName, String subAddr, long userAddressId, long userId) {
        this.cityId = cityId;
        this.detailAddr = detailAddr;
        this.latPoint = latPoint;
        this.isDefault = isDefault;
        this.lonPoint = lonPoint;
        this.preAddr = preAddr;
        this.receiverMobile = receiverMobile;
        this.receiverName = receiverName;
        this.subAddr = subAddr;
        this.userAddressId = userAddressId;
        this.userId = userId;
    }

    public long getCityId() {
        return cityId;
    }

    public void setCityId(long cityId) {
        this.cityId = cityId;
    }

    public String getDetailAddr() {
        return detailAddr;
    }

    public void setDetailAddr(String detailAddr) {
        this.detailAddr = detailAddr;
    }

    public int getIsDefault() {
        return isDefault;
    }

    public void setIsDefault(int isDefault) {
        this.isDefault = isDefault;
    }

    public double getLatPoint() {
        return latPoint;
    }

    public void setLatPoint(double latPoint) {
        this.latPoint = latPoint;
    }

    public double getLonPoint() {
        return lonPoint;
    }

    public void setLonPoint(double lonPoint) {
        this.lonPoint = lonPoint;
    }

    public String getPreAddr() {
        return preAddr;
    }

    public void setPreAddr(String preAddr) {
        this.preAddr = preAddr;
    }

    public String getReceiverMobile() {
        return receiverMobile;
    }

    public void setReceiverMobile(String receiverMobile) {
        this.receiverMobile = receiverMobile;
    }

    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    public String getSubAddr() {
        return subAddr;
    }

    public void setSubAddr(String subAddr) {
        this.subAddr = subAddr;
    }

    public long getUserAddressId() {
        return userAddressId;
    }

    public void setUserAddressId(long userAddressId) {
        this.userAddressId = userAddressId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(cityId);
        dest.writeString(detailAddr);
        dest.writeDouble(latPoint);
        dest.writeInt(isDefault);
        dest.writeDouble(lonPoint);
        dest.writeString(preAddr);
        dest.writeString(receiverMobile);
        dest.writeString(receiverName);
        dest.writeString(subAddr);
        dest.writeLong(userAddressId);
        dest.writeLong(userId);
    }


    public static final Creator<UserAddressBean> CREATOR = new Creator<UserAddressBean>() {
        public UserAddressBean createFromParcel(Parcel in) {
            return new UserAddressBean(in);
        }

        public UserAddressBean[] newArray(int size) {
            return new UserAddressBean[size];
        }
    };


    private UserAddressBean(Parcel in) {
        cityId = in.readLong();
        detailAddr = in.readString();
        latPoint = in.readDouble();
        isDefault = in.readInt();
        lonPoint = in.readDouble();
        preAddr = in.readString();
        receiverMobile = in.readString();
        receiverName = in.readString();
        subAddr = in.readString();
        userAddressId = in.readLong();
        userId = in.readLong();
    }


}
